/**
 * ContractService.java
 * 2008-3-13
 * @author 屈甲康qujiakang@gmail.com
 */
package org.jackysoft.service;

import java.io.File;
import java.util.Collection;
import java.util.Map;

import org.jackysoft.data.IDataProvider;
import org.jackysoft.entity.Contract;
import org.jackysoft.entity.ContractClient;
import org.jackysoft.entity.ContractDataItem;
import org.jackysoft.entity.ContractItem;
import org.jackysoft.entity.Department;
import org.jackysoft.entity.Product;
import org.jackysoft.entity.ProductIncomeItem;
import org.jackysoft.query.Query;
import org.jackysoft.report.ProductValidation;
import org.jackysoft.util.Page;
import org.joda.time.DateTime;
import org.springframework.dao.DataAccessException;

/**
 *  年计划Service
 * @author Administrator
 *
 */
public interface ContractService extends IDataProvider<String,Contract>{
	
    void updateDetail(ContractDataItem dataItem);
	void updateItem(ContractItem item);
	void removeItem(Contract contract,ContractItem item);
	
	void submitLine(ProductIncomeItem item);
	Collection<ProductIncomeItem> showSubmitLine(Contract cont ,ContractItem item);
	
	Collection<ProductIncomeItem> myIncomeItems(DateTime owner);
	
	Collection<Contract> findContractsByCode(Product pdt);
	
	void removeContract(Integer year);
	
	Collection<String> getContractNames() ;
	
	
	Contract getByName(String name);

	Collection<Contract> getsByClient(ContractClient client);
	
	
	void turnin(ProductIncomeItem income);
	
	void removeIncome(String id);
	
	String create(File file, Integer year);
    
    void updateStorage(Contract cont,Product product,Double outcome);
	
    Collection<ContractItem> search(ContractClient client);
    Collection<ContractItem> search(Product product);
    Collection<ContractItem> search(Department product);
    Collection<ContractItem> search(ProductValidation validation);
    /**
     * @param
     * flag : <dd>0 year
     *        <dd>1 quota
     *        <dd>2 month
     * */
    Collection<ContractItem> search(DateTime dt,int flag);
    
    Page collect(Query query) throws DataAccessException;
    int countByExpress(Query query);
    
}